import java.util.Arrays;
import java.util.Scanner;

/**
 * @author 徐志荣
 * @date 2023/3/20 19:34
 */
public class Test2 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        while(in.hasNext()){
            int n = in.nextInt();
            long[] array = new long[3*n];
            for(int i=0;i<(3*n) ;i++){
                array[i] = in.nextLong();

            }
            Arrays.sort(array);
            long sum = 0;
            for(int i = 0;i<n;i++){
                sum += array[array.length - (2*(i+1))];

            }
            System.out.println(sum);
        }
    }
}
